# Import
from d3blocks import D3Blocks

# https://d3blocks.github.io/d3blocks/pages/html/Timeseries.html

def demo1():
    # Initialize
    d3 = D3Blocks()
    #
    # 会从github上下载数据源
    df = d3.import_example('climate')
    #
    # Show
    d3.timeseries(df, datetime='date', dt_format='%Y-%m-%d', fontsize=10, figsize=[850, 500])

def demo2():
    # Initialize
    d3 = D3Blocks(chart='Timeseries', frame=False)
    #
    # Import example
    df = d3.import_example('climate')
    #
    # Node properties
    d3.set_node_properties(df.columns.values)
    d3.node_properties.get('wind_speed')['color']='#000000'
    print(d3.node_properties)
    #
    d3.set_edge_properties(df, datetime='date', dt_format='%Y-%m-%d')
    d3.edge_properties
    #
    # Show
    d3.show(title='Timeseries with adjusted configurations')

demo2()